package cn.wolfcode.wms.qo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;

@Getter
@Setter
public class OrderBillQueryObject extends QueryObject{

    @DateTimeFormat(pattern = "yyyy-mm-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-mm-dd")
    private Date endDate;
    private Long supplierId = -1L;
    private Integer status = -1;

    public void  setEndDate(Date date){
        if (date==null){
            return ;
        }
        Calendar calendar =Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY,23);
        calendar.set(Calendar.MINUTE,59);
        calendar.set(Calendar.SECOND,59);
        this.endDate = calendar.getTime();

    }

    public static  void main(String[] args){
        Calendar calendar =Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY,23);
        calendar.set(Calendar.MINUTE,59);
        calendar.set(Calendar.SECOND,59);
        System.out.println(calendar.getTime().toLocaleString());
    }


}
